﻿IF EXISTS (SELECT * FROM sysobjects WHERE type = 'P' AND name = 'proc_cm_ListEvent')
BEGIN
    PRINT 'Dropping Procedure proc_cm_ListEvent'
    DROP  Procedure  proc_cm_ListEvent
END
GO

PRINT 'Creating Procedure proc_cm_ListEvent'
GO

CREATE PROCEDURE [dbo].[proc_cm_ListEvent]
	@pHtmlPageId uniqueidentifier
AS
BEGIN
	SET NOCOUNT ON

	SELECT 
		[event_id]
		,[subject_txt]
		,[start_dttm]
		,[end_dttm]
		,[description_txt]
		,[recurrence_settings]
		,[parent_event_id]
		,[create_dttm]
		,[update_dttm]
	FROM
		[dbo].[tbl_event] (NOLOCK)
	WHERE
		[html_page_id] = @pHtmlPageId
END
GO

GRANT EXEC ON dbo.proc_cm_ListEvent TO PUBLIC
GO

